#include "main.h"
float grid_width = 10;

vector2 pre = tovector2 (0,0), post;


float togridvalue(float num,float factor)
{
    int num2 = num / (grid_width*factor);
    return num2*(grid_width*factor);
}

bool isgridchage(vector2 pos)
{
    if (pre.x == pos.x && pre.y == pos.y)
        return false;
    else
    {
        //log("Grid changed");
        pre = pos;
        return true;
    }
}

void setgridwidth(float num)
{
    grid_width = num;
}
